import { http } from './service.js'
//家长端

//时光轴
export const getTimeline = (pageNum, pageSize) => {
	return http.request({
		url: '/wx/api/feed/getFeedList',
		method: 'GET',
		params: {
			'pageNum': pageNum,
			'pageSize': pageSize,
		}
	});
}
//园区动态
export const getClasscircle = (pageNum, pageSize) => {
	return http.request({
		url: '/wx/api/school/classcircle',
		method: 'GET',
		params: {
			'pageNum': pageNum,
			'pageSize': pageSize,
		}
	});
}

export const feedPost = (formData) => {
	return http.upload('/wx/api/feed/post_plain', {
		formData: formData,
	})
	// return http.request({
	// 	url: '/wx/api/feed/post_plain',
	// 	method: 'POST',
	// 	params: formData
	// });
}

export const feedPostByFile = (formData, files) => {
	return http.upload('/wx/api/feed/post', {
		formData: formData,
		files: files
	})
}

//教师端
export const recordPageByAreaId = (pageNum, pageSize) => {
	return http.request({
		url: '/pad/live_record/record_page_by_areaId',
		method: 'POST',
		params: {
			'pageNum': pageNum,
			'pageSize': pageSize,
		}
	})
}

export const recordPageByPlanId = (coursePlanId, pageNum, pageSize) => {
	return http.request({
		url: '/pad/live_record/record_by_plan',
		method: 'POST',
		params: {
			'coursePlanId': coursePlanId,
			'pageNum': pageNum,
			'pageSize': pageSize,
		}
	})
}
export const liveRecordAdd = (data) => {
	return http.post('/pad/live_record/add_plain', data,{
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
	})
}

export const liveRecordAddByFile = (formData, files) => {
	return http.upload('/pad/live_record/add', {
		formData: formData,
		files: files
	})
}

export const getRecordChildren = () => {
	return http.request({
		url: 'pad/live_record/all_children',
		method: 'POST',
	})
}

export const deleteLiveRecord = (recordId) => {
	return http.request({
		url: '/pad/live_record/deleteLiveRecord',
		method: 'DELETE',
		params: {
			'recordId': recordId
		}
	})
}
